/**
 * Generate time : 2011-05-27 10:19:30
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cm.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCMDepotpeopleInfo
 * 
 */
public class ZMCMDepotpeopleInfo extends DaoEPBase {

	private String fdKeyId = " "; /* 主键 */
	private String fdDepotId = " "; /* 库房ID */
	private String fdPeopleId = " "; /* 人员ID */
	private Long fdManagmentPermission = new Long(0); /* 管理权限 */
	private Long fdViewPermission = new Long(0); /* 查看权限 */
	// 新增字段
	private String fdOrgId = " "; /* 机构ID */
	private String fdDepartment = "";// 部门名称
	private String fdPeopleName = "";// 人员名称

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDepotId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("库房ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdPeopleId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("人员ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdManagmentPermission");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("管理权限");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdViewPermission");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("查看权限");
		eiMetadata.addMeta(eiColumn);

		// 新加列
		eiColumn = new EiColumn("fdOrgId");
		eiColumn.setFieldLength(50);
		eiColumn.setDescName("机构ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDepartment");
		eiColumn.setFieldLength(50);
		eiColumn.setDescName("机构名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdPeopleName");
		eiColumn.setFieldLength(50);
		eiColumn.setDescName("人员名称");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCMDepotpeopleInfo() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - 主键
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - 主键
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdDepotId - 库房ID
	 * 
	 * @return the fdDepotId
	 */
	public String getFdDepotId() {
		return this.fdDepotId;
	}

	/**
	 * set the fdDepotId - 库房ID
	 */
	public void setFdDepotId(String fdDepotId) {
		this.fdDepotId = fdDepotId;
	}

	/**
	 * get the fdPeopleId - 人员ID
	 * 
	 * @return the fdPeopleId
	 */
	public String getFdPeopleId() {
		return this.fdPeopleId;
	}

	/**
	 * set the fdPeopleId - 人员ID
	 */
	public void setFdPeopleId(String fdPeopleId) {
		this.fdPeopleId = fdPeopleId;
	}

	/**
	 * get the fdManagmentPermission - 管理权限
	 * 
	 * @return the fdManagmentPermission
	 */
	public Long getFdManagmentPermission() {
		return this.fdManagmentPermission;
	}

	/**
	 * set the fdManagmentPermission - 管理权限
	 */
	public void setFdManagmentPermission(Long fdManagmentPermission) {
		this.fdManagmentPermission = fdManagmentPermission;
	}

	/**
	 * get the fdViewPermission - 查看权限
	 * 
	 * @return the fdViewPermission
	 */
	public Long getFdViewPermission() {
		return this.fdViewPermission;
	}

	/**
	 * set the fdViewPermission - 查看权限
	 */
	public void setFdViewPermission(Long fdViewPermission) {
		this.fdViewPermission = fdViewPermission;
	}

	/**
	 * @return the fdOrgId
	 */
	public String getFdOrgId() {
		return fdOrgId;
	}

	/**
	 * @param fdOrgId
	 *            the fdOrgId to set
	 */
	public void setFdOrgId(String fdOrgId) {
		this.fdOrgId = fdOrgId;
	}

	/**
	 * @return the fdDepartment
	 */
	public String getFdDepartment() {
		return fdDepartment;
	}

	/**
	 * @param fdDepartment
	 *            the fdDepartment to set
	 */
	public void setFdDepartment(String fdDepartment) {
		this.fdDepartment = fdDepartment;
	}

	/**
	 * @return the fdPeopleName
	 */
	public String getFdPeopleName() {
		return fdPeopleName;
	}

	/**
	 * @param fdPeopleName
	 *            the fdPeopleName to set
	 */
	public void setFdPeopleName(String fdPeopleName) {
		this.fdPeopleName = fdPeopleName;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdDepotId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDepotId")), fdDepotId));
		setFdPeopleId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdPeopleId")), fdPeopleId));
		setFdManagmentPermission(NumberUtils.toLong(StringUtils.toString(map.get("fdManagmentPermission")), fdManagmentPermission));
		setFdViewPermission(NumberUtils.toLong(StringUtils.toString(map.get("fdViewPermission")), fdViewPermission));
		// 新加字段
		setFdOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdOrgId")), fdOrgId));
		setFdDepartment(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDepartment")), fdDepartment));
		setFdPeopleName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdPeopleName")), fdPeopleName));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdDepotId", StringUtils.toString(fdDepotId, eiMetadata.getMeta("fdDepotId")));
		map.put("fdPeopleId", StringUtils.toString(fdPeopleId, eiMetadata.getMeta("fdPeopleId")));
		map.put("fdManagmentPermission", StringUtils.toString(fdManagmentPermission, eiMetadata.getMeta("fdManagmentPermission")));
		map.put("fdViewPermission", StringUtils.toString(fdViewPermission, eiMetadata.getMeta("fdViewPermission")));
		// 新加字段
		map.put("fdOrgId", StringUtils.toString(fdOrgId, eiMetadata.getMeta("fdOrgId")));
		map.put("fdDepartment", StringUtils.toString(fdDepartment, eiMetadata.getMeta("fdDepartment")));
		map.put("fdPeopleName", StringUtils.toString(fdPeopleName, eiMetadata.getMeta("fdPeopleName")));
		return map;

	}
}